package guanying;

import java.util.Objects;

public class Movies {
    private String name;
    private String type;
    private int  popularity;//电影人气

    public Movies() {
    }

    public Movies(String name, String type, int popularity) {
        this.name = name;
        this.type = type;
        this.popularity = popularity;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getPopularity() {
        return popularity;
    }

    public void setPopularity(int popularity) {
        this.popularity = popularity;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Movies movies = (Movies) o;
        return popularity == movies.popularity && Objects.equals(name, movies.name) && Objects.equals(type, movies.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, type, popularity);
    }

    @Override
    public String toString() {
        return "电影名称：" + name + "  电影类型：" + type + "  电影人气：" + popularity;
    }
}
